package com.jeecms.pay.model;

import com.jeecms.pay.constant.PayCountryEnum;
import com.jeecms.pay.constant.PayGoalEnum;
import com.jeecms.pay.constant.PayTypeEnum;

/**
 * 支付参数
 * 
 * @author web
 * 
 */
public class PayPara implements PayInputPara {
	/**
	 * 充值国家
	 */
	private PayCountryEnum payCountryEnum;
	/**
	 * 充值类型
	 */
	private PayTypeEnum payTypeEnum;
	/**
	 * 充值金额
	 */
	private float payNum;
	/**
	 * 如果是充值到游戏，该对象不为空
	 */
	private GameEntity gameEntity;

	/**
	 * 充值目标，是充值到游戏还是充值到平台
	 */
	private PayGoalEnum payGoalEnum;

	private PayPara() {

	}

	public static PayPara payToGame(PayCountryEnum payCountryEnum, PayTypeEnum payTypeEnum, GameEntity gameEntity,
			float payNum) {
		PayPara pay = new PayPara();
		pay.setGameEntity(gameEntity);
		pay.setPayCountryEnum(payCountryEnum);
		pay.setPayGoalEnum(PayGoalEnum.game);
		pay.setPayNum(payNum);
		pay.setPayTypeEnum(payTypeEnum);
		return pay;
	}

	public static PayPara payToPlatform(PayCountryEnum payCountryEnum, PayTypeEnum payTypeEnum, float payNum) {
		PayPara pay = new PayPara();
		pay.setPayCountryEnum(payCountryEnum);
		pay.setPayGoalEnum(PayGoalEnum.platform);
		pay.setPayNum(payNum);
		pay.setPayTypeEnum(payTypeEnum);
		return pay;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append(super.toString()).append("\n");
		sb.append("充值国家-payCountryEnum=").append(payCountryEnum.name()).append("\n");
		sb.append("充值类型-payTypeEnum=").append(payTypeEnum.name()).append("\n");
		sb.append("充值到游戏-gameEntity=").append(gameEntity != null ? gameEntity.toString() : "null").append("\n");
		sb.append("充值目标-payGoalEnum=").append(payGoalEnum.name()).append("\n");
		return sb.toString();
	}

	public PayGoalEnum getPayGoalEnum() {
		return payGoalEnum;
	}

	private void setPayGoalEnum(PayGoalEnum payGoalEnum) {
		this.payGoalEnum = payGoalEnum;
	}

	public PayCountryEnum getPayCountryEnum() {
		return payCountryEnum;
	}

	private void setPayCountryEnum(PayCountryEnum payCountryEnum) {
		this.payCountryEnum = payCountryEnum;
	}

	public PayTypeEnum getPayTypeEnum() {
		return payTypeEnum;
	}

	private void setPayTypeEnum(PayTypeEnum payTypeEnum) {
		this.payTypeEnum = payTypeEnum;
	}

	public float getPayNum() {
		return payNum;
	}

	private void setPayNum(float payNum) {
		this.payNum = payNum;
	}

	public GameEntity getGameEntity() {
		return gameEntity;
	}

	private void setGameEntity(GameEntity gameEntity) {
		this.gameEntity = gameEntity;
	}

}
